package com.th.supcom.pds.impl.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;

import com.th.supcom.pds.domain.pojo.InpPhamApplyDetail;
import com.th.supcom.pds.domain.pojo.InpPhamApplyDetailSummary;
import com.th.supcom.pds.domain.vo.InpPhamApplyDetailVO;

/**
 * InpPhamApplyDetail Mapper接口.
 * 
 * 住院摆药请领明细.
 */
public interface InpPhamApplyDetailMapper
{
    /**
     * 通过主键ID查询表记录.
     * 
     * @param id 主键ID.
     * @return InpPhamApplyDetail 传输对象.
     */
    public InpPhamApplyDetail getInpPhamApplyDetailByID (@Param ("id") Long id);

    /**
     * 通过传输对象对应值查询表记录.
     * 
     * @param params Map入参对象.
     * @return CpoeInOrder 结果对象集.
     */
    public List <InpPhamApplyDetail> findInpPhamApplyDetailListByMap (Map <String, Object> params);

    /**
     * 通过传输对象对应值查询表记录并且进行分页.
     * 
     * @param rowBounds 分页对象.
     * @param params Map入参对象.
     * @return CpoeInOrder 结果对象集.
     */
    public List <InpPhamApplyDetail> findInpPhamApplyDetailPagingByMap (RowBounds rowBounds, Map <String, Object> params);

    /**
     * 按条件统计事件类型.
     * 
     * @param params 查询参数
     * @return 符合条件的个数
     */
    public Integer findInpPhamApplyDetailCountByMap (Map <String, Object> params);

    /**
     * 通过传输对象对应值查询表记录.
     * 
     * @param inpPhamApplyDetail 传输对象.
     * @return InpPhamApplyDetailVO 结果对象.
     */
    public List <InpPhamApplyDetailVO> findInpPhamApplyDetailListByExample (InpPhamApplyDetail inpPhamApplyDetail);
    /**
     * 通过传输对象对应值查询表记录.(用于住院和核对发药)
     * 
     * @param inpPhamApplyDetail 传输对象.
     * @return InpPhamApplyDetailVO 结果对象.
     */
    public List <InpPhamApplyDetailVO> findInpPhamApplyDetailListByCondition (InpPhamApplyDetail inpPhamApplyDetail);
    /**
     * 请领撤销查询
     * @param inpPhamApplyDetail 传输对象.
     * @return InpPhamApplyDetailVO 结果对象.
     */
    public List <InpPhamApplyDetailVO> findInpPhamApplyCancelListByCondition (InpPhamApplyDetailVO inpPhamApplyDetailVO);

    /**
     * 查询护理单元可冲抵药品汇总
     * 
     * @param inpPhamApplyDetail
     * @return
     */
    public List <InpPhamApplyDetailVO> findOffsetPhamByNurseUnitCode (List <InpPhamApplyDetailSummary> list);

    /**
     * 查询护理单元可冲抵药品明细
     * 
     * @param inpPhamApplyDetail
     * @return
     */
    public List <InpPhamApplyDetailVO> findOffsetPhamList (List <InpPhamApplyDetailSummary> list);

    /**
     * 通过传输对象对应值查询表记录条数.
     * 
     * @param inpPhamApplyDetail 传输对象.
     * @return 条数.
     */
    public int findInpPhamApplyDetailCountByExample (InpPhamApplyDetail inpPhamApplyDetail);

    /**
     * 通过主键ID更新表记录.
     * 
     * @param inpPhamApplyDetail 更新的传输对象.
     * @return 更新条数.
     */
    public int modifyInpPhamApplyDetail (InpPhamApplyDetail inpPhamApplyDetail);

    /**
     * 通过主键ID批量更新表记录.
     * 
     * @param list 更新的传输对象.
     * @return 更新条数.
     */
    public int modifyInpPhamApplyDetailList (List <InpPhamApplyDetail> list);

    /**
     * 通过主键ID更新表记录，字段有值才更新.
     * 
     * @param inpPhamApplyDetail 更新的传输对象.
     * @return 更新条数.
     */
    public int modifyInpPhamApplyDetailByExample (InpPhamApplyDetail inpPhamApplyDetail);

    /**
     * 通过VO对象插入记录.
     * 
     * @param inpPhamApplyDetail 插入的传输对象.
     */
    public void addInpPhamApplyDetail (InpPhamApplyDetail inpPhamApplyDetail);

    /**
     * 批量添加住院请领明细.
     * 
     * @param inpPhamApplyDetail 插入的传输对象.
     */
    public void addInpPhamApplyDetailList (List <InpPhamApplyDetail> list);

    /**
     * 通过主键ID删除表记录.
     * 
     * @param id 删除的主键ID.
     * @return 删除条数.
     */
    public int removeInpPhamApplyDetailByID (@Param ("id") Long id);

    /**
     * 通过传入的Map参数删除表记录.
     * 
     * @param params 带条件的传入参数.
     * @return 删除条数.
     */
    public int removeInpPhamApplyDetailByMap (Map <String, Object> params);

    /**
     * 通过phamStdCode查询药品单位
     * 
     * @param phamStdCode
     * @return
     */
    public String findPhamUnitByPhamStdCode (String phamStdCode);

    /**
     * 通过患者流水号ID列表 、请领执行科室、申请单号
     * 
     * @param inpPhamApplyDetailVO
     * @return
     */
    public List <InpPhamApplyDetail> findInpPhamApplyDetailForReturn (InpPhamApplyDetailVO inpPhamApplyDetailVO);

    /**
     * 通过药品编码查询 药品的不可退药标志
     * @param inpPhamApplyDetail
     * @return
     */
    public List <InpPhamApplyDetail> getDrugReturnIndicator (InpPhamApplyDetail inpPhamApplyDetail);
    
    

    /** 公司版权信息. */
    public static final String copyright = "Copyright 2014, TH Supcom Corporation";

    /** 提交路径. */
    public static final String SCC_BRANCH = "$URL$";

    /** 提交日期. */
    public static final String SCC_LAST_MODIFICATION_DATE = "$Date$";

    /** 最终修改人员. */
    public static final String SCC_LAST_MODIFIER_NAME = "$Author$";

    /** 最终版本号. */
    public static final String SCC_REVISION = "$Revision$";
}